package com.beep.erp.common.base.simpleactivity;

import com.beep.erp.R;
import com.beep.erp.model.PurchaseViewPageFragment;
import com.beep.erp.model.earlystage.EarlyStageViewPageFragment;

/**
 * FileName: SimpleBackPage
 * description:
 * Author: Jolly
 * Date: 2018/8/22
 */
public enum SimpleBackPage {
    ENTRUST(1, R.string.order, PurchaseViewPageFragment.class),
    RERLYSTAGE(2, R.string.early_stage, EarlyStageViewPageFragment.class);


    private int title;
    private Class<?> clz;
    private int value;

    SimpleBackPage(int value, int title, Class<?> clz) {
        this.value = value;
        this.title = title;
        this.clz = clz;
    }

    public int getTitle() {
        return title;
    }

    public void setTitle(int title) {
        this.title = title;
    }

    public Class<?> getClz() {
        return clz;
    }

    public void setClz(Class<?> clz) {
        this.clz = clz;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public static SimpleBackPage getPageByValue(int val) {
        for (SimpleBackPage p : values()) {
            if (p.getValue() == val)
                return p;
        }
        return null;
    }
}
